#ifndef  MYMAINSCRIPT_HPP
# define MYMAINSCRIPT_HPP

# include <Shinygami/game.hpp>
# include "level1.hpp"
#include <iostream>

class MyMainScript : public Shiny::MainScript
{
public:
    MyMainScript(Shiny::Game&, Shiny::Widgets::Ui&);

    void EventClicked(Shiny::Widgets::Container* container, sf::Event event);
    void DrawMenuBackground(sf::RenderTarget&);

    void LevelEnded(bool);

    void PickerToggle(Shiny::Widgets::Container* container, sf::Event);
    void Hero1Picked(Shiny::Widgets::Container* container);
    void Hero2Picked(Shiny::Widgets::Container* container);
    void Hero3Picked(Shiny::Widgets::Container* container);
    void Hero4Picked(Shiny::Widgets::Container* container);

    void ChangePlayerQuantity(Shiny::Widgets::Container* container);

private:
    bool                _endLevelLater;
    Shiny::Game&        _game;
    Shiny::Widgets::Ui& _ui;
    Shiny::Widgets::Ui* _uiPicker;
    Shiny::Widgets::Ui* _mainMenu;
    sf::Sprite          _slapshscreen;

    bool                _pickerVisible;
    int                 _numPlayers;
    std::string         playerPick[4];
    Shiny::Widgets::Container *widgetPlayer1Pick, *widgetPlayer2Pick;

    Shiny::Controls     _playersControl[4];
};

#endif
